#ifndef SRI_COMM_MANAGER_H
#define SRI_COMM_MANAGER_H

#include "sdfs_tcp_pkg/sriCommDefine.h"
#include "sdfs_tcp_pkg/sriCommTCPClient.h"
#include "sdfs_tcp_pkg/sriCommATParser.h"
#include "sdfs_tcp_pkg/sriCommM8218Parser.h"
#include <sys/ipc.h>
#include <sys/shm.h>
#include <cstring>
#include <ros/ros.h>
#include "std_msgs/String.h"
class CSRICommManager
{
public:
	CSRICommManager();
	~CSRICommManager();

 

	float forcex;
	float forcey;
	float forcez; 
	float torquex;
	float torquey;
	float torquez; 
    float GetForceX() const { return forcex; };
	float GetForceY() const { return forcey; };
	float GetForceZ() const { return forcez; };
	bool Init();
	bool Run();
	bool Stop();
	bool SendCommand(std::string command, std::string parames);
	
	bool OnNetworkFailure(std::string infor);//通讯失败
	bool OnCommACK(std::string command);//ACK应答数据处理
	bool OnCommM8218(float fx, float fy, float fz, float mx, float my, float mz);//GSD数据处理
private:
	CSRICommTCPClient mTCPClient;
	CSRICommATParser mATParser;//AT指令解析器
	CSRICommM8218Parser mM8218Parser;//GSD数据解析器
	
	bool mIsGetACK;
	std::string mCommandACK;
	std::string mParamesACK;

};

#endif
